package com.chencs.app.special.service;

import com.chencs.vo.net.request.RequestBase;
import com.chencs.vo.net.request.SpecialRequest;
import com.chencs.webmvc.rest.RestFullTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Administrator on 2017/10/10.
 */
@Service
public class AppSpecialService {

    @Autowired
    RestFullTemplate restTemplate;
    private static final String URLPATH = "service-common/app/special/";

    /**
     * 获取专题列表
     * @return
     */
    @RequestMapping(value = "/getSpecialList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String getSpecialList(@RequestBody RequestBase request){
        String ret = restTemplate.postForObject(URLPATH + "getSpecialList", String.class,request);
        return ret;
    }

    /**
     * 获取專題詳情
     * @return
     */
    @RequestMapping(value = "/findSpecial", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String findSpecial(@RequestBody SpecialRequest request){
        String ret = restTemplate.postForObject(URLPATH + "findSpecial", String.class,request);
        return ret;
    }


    /**
     *
     * @return
     */
    @RequestMapping(value = "/findSpecialProBySid", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String findSpecialProBySid(@RequestBody SpecialRequest request){
        String ret = restTemplate.postForObject(URLPATH + "findSpecialProBySid", String.class,request);
        return ret;
    }
}
